package com.itheima.dao;

import com.itheima.pojo.OrderSetting;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

public interface OrderSettingDao {

    @Insert("insert into t_ordersetting (orderDate,number) values (#{orderDate},#{number})")
    void add(OrderSetting orderSetting);

    void update(OrderSetting orderSetting);

    @Select("select count(*) from t_ordersetting where orderDate = #{orderDate}")
    Integer findCountByOrderDate(Date orderDate);

    @Select("select * from t_ordersetting where orderDate between #{start} and #{end}")
    List<OrderSetting> getOrderSetting(@Param("start") String start, @Param("end") String end);

    @Select("select * from t_ordersetting where orderDate = #{orderDate}")
    OrderSetting findOrderSettingByOrderDate(Date date);

    void updateReservation(OrderSetting orderSetting);
}
